<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 
<!DOCTYPE HTML>
<html>
  <head>
    <link rel="stylesheet" href="css/bootstrap.css">   
    <base href="<%=basePath%>">
	<meta charset="UTF-8">
	<title>welcome</title>
	<link rel="stylesheet" href="<%=basePath%>css/bootstrap.css" />
	<link rel="stylesheet" href="<%=basePath%>js/bootstrap.min.js" />
	<link href="<%=basePath%>css/bootstrap-responsive.css" rel="stylesheet">
    <link href="<%=basePath%>js/google-code-prettify/prettify.css" rel="stylesheet">
	<link rel="shortcut icon" href="<%=basePath%>img/logo.jpg">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%=basePath%>img/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%=basePath%>img/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%=basePath%>img/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="<%=basePath%>img/apple-touch-icon-57-precomposed.png">
	
	
	<script type="text/javascript" src="<%=basePath%>js/jquery.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/google-code-prettify/prettify.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-transition.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-alert.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-modal.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-dropdown.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-scrollspy.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-tab.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-tooltip.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-popover.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-button.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-collapse.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-carousel.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-typeahead.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/bootstrap-affix.js"></script>
    <script type="text/javascript" src="<%=basePath%>js/application.js"></script>
    <script src="js/bootstrap.min.js" type="text/javascript"></script>
    <title>登陆首页</title>
	<style type="text/css">
		body {
			background-color:#78BFE9;
		}
		div #todo{
			font-size:24px;
			color:#60BFE9;
			font-weight:bold;		
		}
		
		#myModal{
			position:absolute;
			left:500px;
			top:400px;
			
		}
		
	</style>
  </head>
  
  <body>
    <div class="container" style="margin-top:100px">  
    	
     	<form action="<%=basePath %>login.action" method="post" class="well" style="width:300px;margin:0px auto;height:350px">      		
			<div id="todo">用户登陆</div><br>
			
			<c:choose>
				<c:when test="${param.code =='10002'}">
					<div class="alert alert-error">
						<button class="close" data-dismiss="alert">×</button>用户名或密码错误
					</div>
				</c:when>
				<c:when test="${param.code =='10001'}">
					<div class="alert alert-error">
						<button class="close" data-dismiss="alert">×</button>用户名或密码不能为空
					</div>
				</c:when>
			</c:choose>
			<hr>
			<span style="font-size:16px">用户名</span>&nbsp;&nbsp;
			<input type="text" name="user.username" style="height:25px"class="span3"/><br />
			<span style="font-size:16px">密  &nbsp;&nbsp; 码</span>&nbsp;&nbsp;
			<input type="password" name="user.password" style="height:25px" class="span3">
			<br><br>
			<button type="submit" class="btn-large btn-primary" style="margin-left:58px;width:120px">登陆</button>
		
			<span style="font-size:14px;color:red;">没有账号？</span><br /><br />
			
			<a href="" class="btn" id="reg" role="button" data-toggle="modal" style="margin-left:58px;width:150px;font-size:18px;height:25px;color:#2D91E7">
	 		立即注册新账号
	 		</a>			
		</form>	
		<div class="modal hide fade" id="myModal" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
				<form action="reg.action" method="post" class="well" >
					<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">×</button>
					<h3 id="myModalLabel" style="color:blue;">欢迎你加入我们</h3>
					</div>
					<div class="modal-body" style="padding-left:100px;">
						<span style="font-size:16px">用户名</span>&nbsp;&nbsp;
						<input type="text" name="u.username" style="height:25px"class="span3"/><br />
						<span style="font-size:16px">密  &nbsp;&nbsp; 码</span>&nbsp;&nbsp;
						<input type="password" name="u.password" style="height:25px" class="span3">
									
					</div>
					<div class="modal-footer">
					<button class="btn" type="submit" >确定</button>
					<button class="btn btn-primary" data-dismiss="modal">取消</button>
					</div>
				</form>
		</div>
 		
 	</div>
 	
 	<script type="text/javascript">
 	
 		$(function(){ 
 			$('#reg').click(function(){
 				$('#myModal').modal({
		   		 
				});
 			});
			
		});  
	
 	
 	
 	</script>
  </body>
</html>

